package com.jsb.laundry.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jsb.laundry.model.dto.posts.PostCommentQueryRequest;
import com.jsb.laundry.model.dto.posts.PostQueryRequest;
import com.jsb.laundry.model.entity.JsbPostComments;
import com.jsb.laundry.model.entity.JsbPosts;
import com.jsb.laundry.model.vo.PostCommentVO;
import com.jsb.laundry.model.vo.PostsVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author ching
* @description 针对表【jsb_post_comments(帖子评论表)】的数据库操作Service
* @createDate 2023-08-09 14:06:04
*/
public interface JsbPostCommentsService extends IService<JsbPostComments> {
    /**
     *  帖子添加评论
     *
     * @param postId
     * @param userId
     * @param content
     * @return
     */
    int doAddPostComment(Integer postId, String userId, String content);

    /**
     * 帖子添加评论（内部服务）
     *
     * @param postId
     * @param userId
     * @param content
     * @return
     */
    int doAddPostCommentInner(Integer postId, String userId, String content);
    /**
     * 获取查询条件
     *
     * @param postCommentQueryRequest
     * @return
     */
    QueryWrapper<JsbPostComments> getQueryWrapper(PostCommentQueryRequest postCommentQueryRequest);

    /**
     * 分页获取帖子封装
     *
     * @param postCommentPage
     * @param request
     * @return
     */
    Page<PostCommentVO> getPostCommentPage(String loginUserId, Page<JsbPostComments> postCommentPage, HttpServletRequest request);
}
